<template>
  <div>
    <h3>劳资是儿子Setup</h3>
    <p>age:{{ age }}</p>
    <button @click="onBtnClick">sayHello</button>
  </div>
</template>

<script setup>
// import { defineProps } from 'vue'

// const props = defineProps(["age", "gender"]);
// console.log(props);

const { age, gender } = defineProps({
  age: Number,
  gender: String,
});
console.log(age, gender);

// const emit = defineEmits(["sayHello"])

const emit = defineEmits({
  // sayHello: null,

  // 校验 submit 事件
  sayHello: (...args) => {
    console.log("正在校验sayHello事件的参数", args);
    return false;
  },
});

const onBtnClick = (e) => {
  console.log("onBtnClick");
  emit("sayHello", "张三疯", "黄四郎");
};
</script>

<style lang="scss" scoped></style>
